#include "MatchInterface.h"
#include "ServiceProvider.h"

MatchInterface::MatchInterface(ServiceProvider* i_sp)
	:m_sp(i_sp)
{
}

MatchInterface::~MatchInterface()
{
}

void MatchInterface::InitMatch(Team* const i_t1, Team* const i_t2, void* i_innerParams)
{
	m_matchData.Init(i_t1, i_t2);
	InnerInit(i_innerParams);
}
	
const MatchData& MatchInterface::GetMatchData() const 
{
	return m_matchData;
}

void MatchInterface::InnerInit(void* /*i_innerParams*/)
{
}

void MatchInterface::AppendEvent(const int i_minute, const STL::string& i_category, const STL::string& i_first, const STL::string& i_second)
{
	m_matchData.m_events.push_back(
		Event(i_minute, m_sp->GetMatchEventGenerator().RandomEventMessageInCategory(i_category, i_first, i_second)));
}

void MatchInterface::AppendEvent(const int i_minute, const STL::string& i_category, const STL::string& i_name)
{
	m_matchData.m_events.push_back(Event(i_minute, m_sp->GetMatchEventGenerator().RandomEventMessageInCategory(i_category, i_name)));
}

void MatchInterface::AppendEvent(const int i_minute, const STL::string& i_category)
{
	m_matchData.m_events.push_back(Event(i_minute, m_sp->GetMatchEventGenerator().RandomEventMessageInCategory(i_category)));
}

void MatchInterface::AppendRawEvent(const int i_minute, const STL::string& i_message)
{
	m_matchData.m_events.push_back(Event(i_minute, i_message));
}

